﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MsTestUtilities.RowTests;
using MsTestUtilities;

namespace MsTestUtilitiesTests.RowTests.TestScenarioBuilderTests
{
    [TestClass]
    public class ReverseAutoStandardAssertTests
    {
        [TestMethod]
        public void DoesNotStartWith()
        {
            ExAssert.Throws<AssertFailedException>(() => Test("asdf", "q"));
        }

        [TestMethod]
        public void IsSelfSubstring()
        {
            ExAssert.Throws<AssertFailedException>(() => Test("asdf", "asdfgh"));
        }

        [TestMethod]
        public void IsSuperString()
        {
            Test("asdf", "as");
        }

        private void Test(string given, string expected)
        {
            new TestScenarioBuilder<string, string>()
                .For(g => g)
                .Given(given).XDo(StringAssert.StartsWith, expected).Fact
                .Evaluate();
        }
    }
}
